<html xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout"
      layout:decorator="layout/blank"><!-- layout文件路径-->
<head>
    <title>首页设置</title>
</head>
<body>
<div layout:fragment="content">
    <div id="fakeLoader"></div>
    <!-- START CONTENT FRAME -->
    <div class="content-frame">
        <!-- START CONTENT FRAME LEFT -->
        <div class="content-frame-left">
            <div class="block">
                <button class="btn btn-warning btn-block" id="addCategoryBtn">添加分类</button>
            </div>
            <div class="block">
                <div class="list-group border-bottom" id="categoryList">
                    <a href="#" class="list-group-item " th:each="entity : ${list}" th:data="${entity.id}">
                        <span class="fa fa-inbox" ></span><span th:text="${entity.name}"></span>
                        <!--<span class="badge badge-success">3</span>-->
                    </a>
                </div>
            </div>
        </div>
        <!-- END CONTENT FRAME LEFT -->

        <!-- START CONTENT FRAME BODY -->
        <div class="content-frame-body">

            <div class="panel panel-default">
                <div class="panel-heading">
                    <button class="btn btn-default" data-toggle="modal" data-target="#modal_basic"><span class="fa fa-plus">添加影片</span></button>
                    <button class="btn btn-default" id="edit-category-btn"><span class="fa fa-pencil">编辑分类</span></button>
                    <button class="btn btn-default" id="del-category-btn"><span class="fa fa-trash">删除分类</span></button>
                </div>
                <div class="panel-body mail" id="movieList">

                </div>
            </div>

        </div>
        <!-- END CONTENT FRAME BODY -->
    </div>
    <div class="modal " id="modal_basic" tabindex="-1" role="dialog" aria-labelledby="defModalHead" aria-hidden="true">
        <div class="modal-dialog modal-lg">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                    <h4 class="modal-title" id="defModalHead">Basic Modal</h4>
                </div>
                <div class="modal-body">
                    <table class="table datatable_simple" id="category-movies-table">
                        <thead>
                        <tr>
                            <th>#</th>
                            <th>片名</th>
                            <th>淸晰度</th>
                            <th>区域</th>
                            <th>类型</th>
                            <th>价格</th>
                            <th>已售</th>
                            <th>上架时间</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr th:each="movie : ${movies}">
                            <td><input type="checkbox"  th:value="${movie.id}" /></td>
                            <td th:text="${movie.movie_name}"></td>
                            <td th:each="dic:${dictionaries}" th:if="${dic.keyNo=='MOVIE_CLARITY' and dic.keyValue==movie.clarity}" th:text="${dic.caption}"></td>
                            <td th:each="dic:${dictionaries}" th:if="${dic.keyNo=='MOVIE_AREA' and dic.keyValue==movie.area}" th:text="${dic.caption}"></td>
                            <td th:each="dic:${dictionaries}" th:if="${dic.keyNo=='MOVIE_TYPE' and dic.keyValue==movie.type}" th:text="${dic.caption}"></td>
                            <td th:text="${movie.price}"></td>
                            <td th:text="${movie.total}">0</td>
                            <td th:text="${#dates.format(movie.create_time,'yyyy-MM-dd HH:mm:ss')}"></td>
                        </tr>
                        </tbody>
                    </table>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-success" data-dismiss="modal" id="category-add-movie-btn">确定</button>
                    <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                </div>
            </div>
        </div>
    </div>
</div>
</body>

</html>